﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ini编辑器CS
{
    public partial class Form3 : Form
    {
        MOD mod = null;
        public Form3()
        {
            InitializeComponent();
        }
        public Form3(MOD _mod)
        {
            InitializeComponent();
            mod = _mod;
            textBox1.Text = mod.name;
            textBox2.Text = mod.owner;
            textBox3.Text = mod.version;
            textBox4.Text = mod.element;
        }
        private void button2_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "" || textBox4.Text == "")
                return;
            if (mod == null)
                Global.mod = new MOD(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text);
            else
            {
                mod.name = textBox1.Text;
                mod.owner = textBox2.Text;
                mod.version = textBox3.Text;
                mod.element = textBox4.Text;
            }
            Close();
        }
    }
}
